package com.ruoyi.lock.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.lock.domain.AOutbound;
import com.ruoyi.lock.mapper.AOutboundMapper;
import com.ruoyi.lock.service.IAOutboundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 出库单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-15
 */
@Service
public class AOutboundServiceImpl implements IAOutboundService 
{
    @Autowired
    private AOutboundMapper aOutboundMapper;

    /**
     * 查询出库单
     * 
     * @param oId 出库单主键
     * @return 出库单
     */
    @Override
    public AOutbound selectAOutboundByOId(Long oId)
    {
        return aOutboundMapper.selectAOutboundByOId(oId);
    }

    /**
     * 查询出库单列表
     * 
     * @param aOutbound 出库单
     * @return 出库单
     */
    @Override
    public List<AOutbound> selectAOutboundList(AOutbound aOutbound)
    {
        return aOutboundMapper.selectAOutboundList(aOutbound);
    }

    /**
     * 新增出库单
     * 
     * @param aOutbound 出库单
     * @return 结果
     */
    @Override
    public int insertAOutbound(AOutbound aOutbound)
    {
        aOutbound.setCreateTime(DateUtils.getNowDate());
        return aOutboundMapper.insertAOutbound(aOutbound);
    }

    /**
     * 修改出库单
     * 
     * @param aOutbound 出库单
     * @return 结果
     */
    @Override
    public int updateAOutbound(AOutbound aOutbound)
    {
        aOutbound.setUpdateTime(DateUtils.getNowDate());
        return aOutboundMapper.updateAOutbound(aOutbound);
    }

    /**
     * 批量删除出库单
     * 
     * @param oIds 需要删除的出库单主键
     * @return 结果
     */
    @Override
    public int deleteAOutboundByOIds(Long[] oIds)
    {
        return aOutboundMapper.deleteAOutboundByOIds(oIds);
    }

    /**
     * 删除出库单信息
     * 
     * @param oId 出库单主键
     * @return 结果
     */
    @Override
    public int deleteAOutboundByOId(Long oId)
    {
        return aOutboundMapper.deleteAOutboundByOId(oId);
    }
}
